#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include <string.h>
int Delete1(char s[], char ch)
{
	int i = 0;
	int input = 0;
	while (s[i] != '\0')
	{
		if (s[i] == ch)
		{
			s[i] = '*';
		}
		i++;
	}
	i = 0;
	while (s[i]!='\0')
	{
		if (s[i] != '*')
		{
			input = 1;
			printf("%c", s[i]);
		}
			i++;
	}
	if (input == 0)
	{
		printf("NULL");
		return 0;
	}
	printf("\n");
	return 1;
}
void Delete2(char* p, char ch)
{
	int i = 0;
	int input = 0;
	while (p[i] != '\0')
	{
		if (p[i] == ch)
		{
			p[i] = '*';
		}
		i++;
	}
	i = 0;
	while (p[i] != '\0')
	{
		if (p[i] != '*')
		{
			input = 1;
			printf("%c", p[i]);
		}
		i++;
	}
	if (input == 0)
		printf("NULL");
}
int main()
{
	char arr[50] = { 0 };
	char ch ;
	gets(arr);
	ch = getchar();
		int c=Delete1(arr, ch);
		char* p = arr;
		while (getchar() != '\n')
		{
			;
		}
		if (c)
		{
			ch = getchar();
			Delete2(p, ch);
		}
		return 0;
}